<form class="default" action="" method="post" enctype="multipart/form-data">
	<fieldset>
		<legend>Свойства сообщения</legend>
		<?php foreach ($columns as $column => $data): ?>
		<div class="row">
			<div class="label"><?php echo $column; ?></div>
			<div class="field"><?php
				if ($column == 'id'):
					?><input type="text" name="message[<?php echo $column; ?>]" value="<?php echo htmlspecialchars($message->{$column}); ?>" disabled="disabled" /><?php
				elseif (UTF8::substr($column, 0, 1) == '_'):
					?><input type="file" name="message[<?php echo $column; ?>]" /> <a class="fancybox" href="/uploads<?php echo $message->{$column}; ?>"><?php echo $message->{$column}; ?></a><?php
				elseif ($data['data_type'] == 'text'):
					?><textarea name="message[<?php echo $column; ?>]"><?php echo $message->{$column}; ?></textarea><?php
				else:
					?><input type="text" name="message[<?php echo $column; ?>]" value="<?php echo htmlspecialchars($message->{$column}); ?>" /><?php
				endif;
			?></div>
		</div>
		<?php endforeach; ?>
		<div class="row">
			<input type="submit" name="save_and_return" value="Сохранить и вернуться" />
			<input type="submit" name="save" value="Сохранить" />
		</div>
	</fieldset>
</form>